package com.lm.util;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author: LM
 * @CreateTime: 2025/9/4 09:08
 * @Description: TODO
 * @Version: 1.0
 */
@Data
public class ResultUtil<T> implements Serializable {

    private static final long serialVersionUID = -1612980093063478312L;

    private int code;   // 状态码: 200成功、 500代码错误
    private String msg; // 返回信息: ***成功、 ***失败
    private T data;     // 接口数据: 返回的数据

    // 查询 回显.....
    public ResultUtil(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    // 删除、新增、修改
    public ResultUtil(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}